package org.jeecg.modules.manager.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.DecimalFormat;

/**
 * @author wenhao hu
 * @title: PuroQueryByIdVo
 * @projectName biyesheji
 * @description: TODO
 * @date 2021/12/51:34
 */
@Data
public class PuroQueryByIdVo {
    /**主键*/
    @ApiModelProperty(value = "主键-采购订单id")
    private java.lang.String id;

    @ApiModelProperty(value = "订单组ID")
    private java.lang.String orderGroupId;

    @ApiModelProperty(value = "商品ID")
    private java.lang.String puroGoodsId;

    @ApiModelProperty(value = "商品名")
    private String puroGoodsName;

    @ApiModelProperty(value = "仓库ID")
    private java.lang.String puroRepoId;

    @ApiModelProperty(value = "商品名")
    private String puroRepoName;

    @ApiModelProperty(value = "供应商ID")
    private java.lang.String puroPurId;

    @ApiModelProperty(value = "供应商名")
    private java.lang.String puroPurName;

    /**订单号*/
    @Excel(name = "订单号", width = 15)
    @ApiModelProperty(value = "订单号")
    private java.lang.String puroNumber;
    /**数量*/
    @Excel(name = "数量", width = 15)
    @ApiModelProperty(value = "数量")
    private Integer puroCount;
    /**单价*/
    @Excel(name = "单价", width = 15)
    @ApiModelProperty(value = "单价")
    private String puroPrice;
    /**总价*/
    @Excel(name = "总价", width = 15)
    @ApiModelProperty(value = "总价")
    private String puroTotal;
    /**描述*/
    @Excel(name = "描述", width = 15)
    @ApiModelProperty(value = "描述")
    private java.lang.String puroDescription;
    /**订单状态(0:下单 1:入库 2:退货)*/
    @Excel(name = "订单状态(0:下单 1:入库 2:退货)", width = 15)
    @ApiModelProperty(value = "订单状态(0:下单 1:入库 2:退货)")
    private java.lang.Integer puroStatus;
    /**入库时间*/
    @Excel(name = "入库时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "入库时间")
    private java.util.Date puroImportTime;
    /**审核人*/
    @Excel(name = "审核人", width = 15)
    @ApiModelProperty(value = "审核人")
    private java.lang.String puroInspectUserId;

    public static PuroQueryByIdVo makeVo(PurchaseOrder order){
        PuroQueryByIdVo vo = new PuroQueryByIdVo();
        vo.setId(order.getId());
        vo.setPuroCount(order.getPuroCount());
        vo.setPuroDescription(order.getPuroDescription());
        vo.setPuroGoodsId(order.getPuroGoodsId());
        vo.setPuroCount(order.getPuroCount());
        vo.setPuroPrice(new DecimalFormat("#.00").format(order.getPuroPrice()));
        vo.setPuroTotal(new DecimalFormat("#.00").format(order.getPuroTotal()));
        vo.setOrderGroupId(order.getOrderGroupId());
        vo.setPuroImportTime(order.getPuroImportTime());
        vo.setPuroRepoId(order.getPuroRepoId());
        vo.setPuroPurId(order.getPuroPurId());
        vo.setPuroStatus(order.getPuroStatus());
        return vo;
    }
}
